package com.thinkgem.jeesite.modules.app.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.thinkgem.jeesite.modules.cms.entity.Category;
import com.thinkgem.jeesite.modules.cms.entity.ClassifiedInfo;

import java.util.Date;

/**
 * Created by xiaguoqiang on 16/5/26.
 */
public class ApiClassfiedInfo {
    private String id;
    private String categoryId;// 分类编号
    private String title;	// 标题
    private String link;	// 外部链接
    private String image;	// 文章图片
    private String description;// 描述、摘要
    private Integer hits;	// 点击数
    private String content;
    private String posid;	// 推荐位，多选（1：首页焦点图；2：栏目页文章推荐；）
    protected Date updateDate;	// 更新日期

    public ApiClassfiedInfo(ClassifiedInfo info) {
        this.id = info.getId();
        this.categoryId = info.getCategory().getId();
        this.title = info.getTitle();
        this.link = info.getLink();
        this.image = info.getImage();
        this.description = info.getDescription();
        this.hits = info.getHits();
        this.updateDate = info.getUpdateDate();
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getCategoryId() {
        return categoryId;
    }

    public void setCategoryId(String categoryId) {
        this.categoryId = categoryId;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getLink() {
        return link;
    }

    public void setLink(String link) {
        this.link = link;
    }

    public String getImage() {
        return image;
    }

    public void setImage(String image) {
        this.image = image;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public Integer getHits() {
        return hits;
    }

    public void setHits(Integer hits) {
        this.hits = hits;
    }

    public String getPosid() {
        return posid;
    }

    public void setPosid(String posid) {
        this.posid = posid;
    }

    public String getContent(){ return content; }

    public void setContent(String content){ this.content = content; }

    @JsonFormat(pattern = "yyyy-MM-dd")
    public Date getUpdateDate() {
        return updateDate;
    }

    public void setUpdateDate(Date updateDate) {
        this.updateDate = updateDate;
    }
}
